import { createApp } from "vue";
import App from "./App.vue";
import "@/style.css";

//导入路由
import router from "./router";
//导入路由守卫
import "@/router/guard";
//导elements组件库
import ElementPlus from "element-plus";
import "element-plus/dist/index.css";
import * as ElementPlusIconsVue from "@element-plus/icons-vue";
//导入状态管理库
import { createPinia } from "pinia";
//导入mock文件
import "./mock/index";
//国际化配置
import zhCn from "element-plus/es/locale/lang/zh-cn";

const app = createApp(App);
const pinia = createPinia();

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}

app.use(ElementPlus, {
  locale: zhCn,
});
app.use(pinia);
app.use(router);
app.mount("#app");
